<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2022/10/28
  Time: 22:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>我的订单</title>
    <link type="text/css" href="css/idea.css" rel="stylesheet" />
    <link type="text/css" href="css/user_home.css" rel="stylesheet" />
    <link type="text/css" href="css/user_home_order.css" rel="stylesheet" />
    <link type="text/css" href="css/common.css" rel="stylesheet" />
    <link type="text/css" href="css/reset.css" rel="stylesheet" />
    <link rel="shortcut icon" type="image/x-icon" href="images/nangua.jpg" media="screen" />
    <script type="text/javascript" src="js/common.js"></script>

    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script><!--必须得放在第一的位置-->
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/index_type_more.js"></script>
    <script type="text/javascript" src="js/user_home_order.js"></script>

</head>

<body>


<script>
    function deleteOrder(id) {
      if(confirm("确定删除该订单嘛？")){
          location.href='deleteOrderById.do?orderId='+id;
      }
    }
</script>
<script type="text/javascript">
    $(document).ready(function () {
        myjump(1,3);
    });
    function myjump(page,size) {
        $.ajax({
            url:"getOrderByUserId.do",
            type:"GET",
            data:{page:page,size:size},
            dataType:"json",
            success:function (msg) {
                if(msg.flag==1){
                    var datalist=msg.data.olist;
                    var html='';
                    for (var i = 0; i<datalist.length; i++) {
                        html+='<div class="content_goods_order_con_con_" style="border: none">';
                        html+='<div class="content_goods_order_con_c_top" style="margin-left: -13px;color: #888"><!--必须加label，不然不在同一行-->';

                        html+='<div class="con_number fl" >订单编号：<span class="span1">'+datalist[i].order_code+'</span></div>';
                        html+='<div class="con_time fl">生成时间：<span class="span1">'+datalist[i].order_datetime+'</span></div>';
                        html+='</div>';
                        html+='<div class="content_goods_order_con_con " style="font-size: 15px;">';
                        html+='<div class="con_goods1 fl clearfix">';
                        html+='<div class="pic fl"><img src="${applicationScope.basePath}'+'upload/'+datalist[i].pic_main+'" width="110" height="80"/></div>';
                        html+='<div class="details fl"><a href="javascript:void(0)">'+datalist[i].car_name+'<span class="">'+datalist[i].car_regist+'&nbsp;&nbsp;上牌</span><em class="shuxian">|</em>行驶&nbsp;'+datalist[i].car_mile+'&nbsp;万公里</a></div>';
                        html+='</div>';
                        html+='<div style="width: 172px;float: left;margin-left: -10px">'+datalist[i].car_price+'万</div>';
                        html+= '<div style="width: 160px;float: left">'+datalist[i].order_price+'&nbsp;元(定金)</div>';
                        html+= '<div style="width: 190px;float: left">' +datalist[i].order_status+'</div>';
                        html+= '<div style="width: 100px;float: left;padding-left: 10px"><a href="#">删除</a></div>';
                        html+='</div>';
                        html+='<div class="hr_10"></div>';
                    }
                    var str = ''
                    str='<a href="javaScript:myjump(1,3)" style="padding: 4px 10px;font-size: 14px; background: #fff;color: #0B6FB0;margin: 0 3px;text-decoration: none;">首页</a>&nbsp;'+
                        '<a href="javaScript:myjump('+(msg.data.page-1)+',3)"style="padding: 4px 10px;font-size: 14px;background: #fff;color: #0B6FB0;margin: 0 3px;text-decoration: none;">上一页</a>&nbsp;'+
                        '<a href="javaScript:myjump('+(msg.data.page+1)+',3)"style="padding: 4px 10px;font-size: 14px;background: #fff;color: #0B6FB0;margin: 0 3px;text-decoration: none;">下一页</a>&nbsp;'+
                        '<a href="javaScript:myjump('+msg.data.maxPage+',3)"style="padding: 4px 10px;font-size: 14px;background: #fff;color: #0B6FB0;margin: 0 3px;text-decoration: none;">尾页</a>' ;

                    $("#orderlist").html(html);
                    $("#pageandsize").html(str);//分页
                    $("#ordernum").html(msg.data.allCount);
                }else if(msg.flag==0){
                    if(msg.info=="您尚未登录请先登录!"){
                        alert("您尚未登录请先登录!");
                        location.href="index.jsp";
                    }else{
                        $("#myfavoritelist").html("您还没有订单，快去下单吧");

                    }

                }
            }

        });
    }
</script>


<div class="index">
    <!--头部导航-->
    <jsp:include page="head.jsp"></jsp:include>
    <!--头部导航结束-->
    <div class="hr_5"></div>
    <div class="user_content f_f width_1200_center">
        <div class="content_position">您当前的位置：<a href="javascript:">首页</a><span>&gt;</span><a href="order.jsp">个人中心</a><span>&gt;</span><a href="mycar.jsp">我卖的车</a></div>
        <!-- <div class="user_content_top f_z15"><a href="#">注册会员</a><span>Register</span></div>-->
        <div class="hr_10"></div>
        <div class="user_content_con over_hidden width_1200_center" style="height: 520px"><!--over_hidden也是清除浮动的一种-->
            <div class="user_content_con_nav fl" style="height: 440px">
                <div class="nav_info">
                    <h1>个人信息</h1>
                    <ul>
                        <li><a href="userhome.jsp">个人资料</a></li>
                        <li><a href="#">收货地址</a></li>
                        <li><a href="#">安全设置</a></li>
                    </ul>
                </div>
                <div class="nav_goods">
                    <h1>商品管理</h1>
                    <ul>
                        <li><a href="order.jsp">我的订单</a></li>
                        <li><a href="mycar.jsp">我卖的车</a></li>
                        <li><a href="mywantsellcar.jsp">卖车预约</a></li>
                        <li><a href="myfavorite.jsp">我想要的</a></li>
                        <li><a href="mycollection.jsp">我的收藏</a></li>
                        <li><a href="myreserve.jsp">看车预约</a></li>
                    </ul>
                </div>

            </div>
            <div class="user_content_con_c fr">
                <div class="content_goods_order f_f width_1000_center">
                    <div class="content_goods_order_top over_hidden width_1000_center">
                        <div class="top_order1 fl"><h1>我的订单</h1></div>

                        <div class="top_all fr"><span class="span1">蓝瓜店-全部订单</span><span class="span2" id="ordernum"></span></div>
                    </div>
                    <div class="content_goods_order_con width_1000_center clearfix" style="height: 500px">
                        <div class="content_goods_order_con_top">
                            <div>
                                <h1 style="float: left;margin-left:50px;" >汽车</h1>
                                <h1 style="float: left;margin-left:345px;">价格</h1>
                                <h1 style="float: left;margin-left:120px;">支付金额</h1>
                                <h1 style="float: left;margin-left:120px;">订单状态</h1>
                                <h1 style="float: left;margin-left:120px;">操作</h1>
                            </div>
                        </div>
                        <div class="hr_5"></div>


                        <!--数据类表-->
                <div id="orderlist" style="border: none">


                </div>

                        <!--分页-->

                        <div align="center" id="pageandsize" style="margin-left: 740px">


                        </div>
                        <!--分页-->

                    </div>
                </div>
            </div><!--右侧我的订单完-->
        </div><!--左右侧完-->
        <!--以后复制的开始-->
        <div class="hr_10"></div>

        <!--以后复制的结束-->
    </div><!--整个内容部分-->






    <div class="hr_8"></div>
    <!--底部-->
    <jsp:include page="foot.jsp"></jsp:include>
    <!--底部-->
</div>

</body>
</html>
